<template>
<a-card :bordered="false">
  <a-tabs tabPosition="left" @change="tabChange">
    <a-tab-pane key="1">
      <span slot="tab">
        <a-icon type="user" />
        待办任务
      </span>
      <MyPendingTask ref="MyPendingTask" />
    </a-tab-pane>
    <!-- <a-tab-pane key="2">
      <span slot="tab">
        <a-icon type="usergroup-add" />
        组任务
      </span>
      <GroupPendingTask ref="GroupPendingTask" />
    </a-tab-pane>
    <a-tab-pane key="3">
      <span slot="tab">
        <a-icon type="usergroup-add" />
        候选任务
      </span>
      <CandidateTask ref="CandidateTask" />
    </a-tab-pane> -->
    <a-tab-pane key="4" >
      <span slot="tab">
        <a-icon type="clock-circle" />
        审批记录
      </span>
      <MyFinishedTask ref="MyFinishedTask" />
    </a-tab-pane>
  </a-tabs>
</a-card>
</template>

<script>
import MyPendingTask from './modules/MyPendingTask'
// import GroupPendingTask from './modules/GroupPendingTask'
// import CandidateTask from './modules/CandidateTask'
import MyFinishedTask from './modules/MyFinishedTask'
export default {
  name: 'MyTaskList',
  components: {
    MyPendingTask,
    MyFinishedTask
    // GroupPendingTask,
    // CandidateTask
  },
  mixins: [],
  data() {
    return {

    }
  },
  methods: {
    tabChange(activeKey) {
      if (activeKey === '1') {
        this.$refs.MyPendingTask && this.$refs.MyPendingTask.loadData()
      } else if (activeKey === '2') {
        this.$refs.GroupPendingTask && this.$refs.GroupPendingTask.loadData()
      } else if (activeKey === '3') {
        this.$refs.CandidateTask && this.$refs.CandidateTask.loadData()
      } else if (activeKey === '4') {
        this.$nextTick(() => {
          this.$refs.MyFinishedTask && this.$refs.MyFinishedTask.loadData()
        })
      }
    }
  }
}
</script>

